import unittest

from parameterized import parameterized

from common.read_data import load_parameterized_data
from common.request_url import request_login_url



class TestLogin(unittest.TestCase):

    @parameterized.expand(load_parameterized_data())
    def test01(self,username,password,authCode,status_code,errorCode):
        res_json_data = request_login_url(username,password,authCode)

        print(f"{status_code}---------{res_json_data.status_code}")
        self.assertEqual(status_code,res_json_data.status_code)

        if res_json_data.status_code != 200:
            self.assertEqual(errorCode,res_json_data.json()["errorCode"])

